package com.xyzboom.compiler.fa

class DFANode<T, K>(
    val value: T,
    val next: MutableMap<FAEdge<K>, DFANode<T, K>>,
) {
    constructor(value: T) : this(value, HashMap())

    override fun toString(): String {
        return "DFANode(value=$value)"
    }

    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other !is DFANode<*, *>) return false

        if (value != other.value) return false

        return true
    }

    override fun hashCode(): Int {
        return value?.hashCode() ?: 0
    }

}